package org.chaiyi.template.core.common.contract;

import lombok.Builder;
import lombok.Data;
import lombok.Getter;
import org.chaiyi.template.core.common.common.BeanNameManage;
import org.chaiyi.template.core.common.repository.MongoEntity;
import org.chaiyi.template.core.common.supporter.MongoSupporter;

/**
 * @author Gong.Yang
 */
@Getter
public class ContractInfo<T extends MongoSupporter, D extends MongoEntity> {
    private final String path;
    private final String name;
    private final Class<T> supporter;
    private final Class<D> entity;
    private final Class<?> iService;
    private final String repositoryName;

    public ContractInfo(String path, String name, Class<T> supporter, Class<D> entity, Class<?> iService) {
        this.path = path;
        this.name = name;
        this.supporter = supporter;
        this.entity = entity;
        this.iService = iService;
        repositoryName = BeanNameManage.getRepositoryName(entity);
    }
}
